//package com.lifeng.finance.demo.controller;
//
//import com.lifeng.finance.demo.entity.Project;
//import com.lifeng.finance.demo.service.ProjectService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.ComponentScan;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//@ComponentScan(basePackages = {"com.lifeng.finance.demo.service.*"})
//@RestController
//public class UserController {
//
//
//    @Autowired
//    private ProjectService customerService;
//
//    @RequestMapping("/")
//    public Project index() {
//        return new Project("lifeng");
//    }
//
//    @RequestMapping("/hello")
//    public List<Project> getName() {
//        return customerService.findAll();
//    }
//
//    @RequestMapping(path = "/findonebyid")
//    public Project findOneById(@RequestParam(name = "id") int id) {
//        return customerService.findOneById(id);
//    }
//
//    @RequestMapping(path = "/findsomebyname")
//    public List<Project> findSomeByName(@RequestParam(name = "name") String name) {
//        return customerService.findSomeByName(name);
//    }
//
//    @RequestMapping(path = "/add")
//
//    public Project add(@RequestParam(name = "name") String name) {
//        Project project = new Project(name);
//        customerService.add(project);
//        return project;
//    }
//
//    @RequestMapping(path = "/update")
//    public Project update(@RequestParam(name = "id") int id, @RequestParam(name = "name") String name) {
//
//        Project project = customerService.findOneById(id);
//        project.setName(name);
//        customerService.update(project);
//        return project;
//    }
//
//}
